﻿namespace CoolCrapServices
{
    using System.Collections.ObjectModel;
    using designpatternsplus.contracts;
    using designpatternsplusplus.decorator;
    using designpatternsplusplus.decorator.ServiceContracts;

    // NOTE: If you change the class name "MarketService" here, you must also update the 
    // reference to "MarketService" in Web.config and in the associated .svc file.
    public class MarketService : IMarketService
    {

        /// <summary>
        /// Proceses the shopping cart.
        /// </summary>
        /// <param name="ProductIDs">The product I ds.</param>
        /// <returns></returns>
        public ISalesReceipt ProcesShoppingCart(Collection<string> ProductIDs)
        {
            var myBasket = CoolCrapMarket.Get.ShoppingCart.AutoScanDiscover(ProductIDs);
            return CoolCrapMarket.Checkout(myBasket);
        }

    }
}